package org.wdcode.back.tag.ui;

import org.wdcode.common.util.CommonUtil;

/**
 * 扩展struts2 TextFieldTag
 * @author WD
 * @since JDK6
 * @version 1.0 2010-03-23
 */
public final class TextFieldTag extends org.apache.struts2.views.jsp.ui.TextFieldTag {
	// 序列化ID
	private static final long	serialVersionUID	= -159509133477380746L;

	/**
	 * 重写方法
	 */
	@Override
	protected void populateParams() {
		// 设置只读
		readonly = CommonUtil.isEmpty(readonly) ? "%{#attr.temUI.get('readonly')}" : readonly;
		// 设置ID
		id = CommonUtil.isEmpty(id) ? "%{#attr.temUI.get('id')}" : id;
		// 设置name
		name = CommonUtil.isEmpty(name) ? "%{#attr.temUI.get('name')}" : name;
		// 设置value
		value = CommonUtil.isEmpty(value) ? getStack().findString("#attr.temUI.get('value')") : value;
		// 设置cssClass
		cssClass = CommonUtil.isEmpty(cssClass) ? "%{#attr.temUI.get('cssClass')}" : cssClass;
		//设置maxlength
		maxlength = CommonUtil.isEmpty(maxlength) ? "%{#attr.temUI.get('maxlength')}" : maxlength;
		// 调用父方法
		super.populateParams();
	}

}
